﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Windows.Media.Imaging;
using ImageConverter.Model.Enums;

namespace ImageConverter.Converters
{
    public class ItemStatusToIconConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ItemStatusEnum eVal = (ItemStatusEnum)value;

            switch (eVal)
            {
                case ItemStatusEnum.Success:
                    return "pack://application:,,,/Images/success_12x12.png";
                case ItemStatusEnum.Warning:
                    return "pack://application:,,,/Images/warning_12x12.png";
                case ItemStatusEnum.Error:
                    return "pack://application:,,,/Images/error_12x12.png";
                case ItemStatusEnum.InProgress:
                    return "pack://application:,,,/Images/running_12x12.png";
                default:
                    return "pack://application:,,,/Images/wait_12x12.png";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
